<!--{include(pe_tpl('header.html'));}-->
<div class="right_page">
	<div class="now">
		<a href="admin.php?mod=order" <!--{if(!$_g_state):}-->class="sel"<!--{endif;}-->>全部订单（{$tongji['all']}）<i></i></a>
		<!--{foreach($ini['order_state'] as $k=>$v):}-->
		<a href="admin.php?mod=order&state={$k}" <!--{if($_g_state==$k):}-->class="sel"<!--{endif;}-->>{$v}（{$tongji[$k]}）<i></i></a>
		<!--{endforeach;}-->
		<a href="admin.php?mod=cainiao&state=wsend_0" id="fabu" onclick="return pe_dialog(this, '菜鸟平台批量发货/打印工具', 1200, 650)">批量发货/打印</a>
		<div class="clear"></div>
	</div>
	<div class="right_main">
		<div class="search">
			<form method="get" autocomplete="off">
				<input type="hidden" name="mod" value="{$_g_mod}" />
				<input type="hidden" name="state" value="{$_g_state}" />
				单号：<input type="text" name="id" value="{$_g_id}" class="inputtext input100 mar5" />
				帐号：<input type="text" name="user_name" value="{$_g_user_name}" class="inputtext input100 mar5" />
				收货人：<input type="text" name="user_tname" value="{$_g_user_tname}" class="inputtext input100 mar5" />
				电话：<input type="text" name="user_phone" value="{$_g_user_phone}" class="inputtext input100 mar5" />
				下单：<input type="text" name="date1" value="{$_g_date1}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate inputtext" style="width:100px;height:20px;" />	
				至 <input type="text" name="date2" value="{$_g_date2}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate inputtext" style="width:100px;height:20px;" />			
				<input type="submit" value="搜索" class="input_btn" />
				<input type="button" value="导出" class="input_btn" id="export_btn" />
			</form>
		</div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
		<tr>
			<th class="bgtt">商品信息</th>
			<th class="bgtt" width="121">实付款</th>
			<th class="bgtt" width="121">用户账号</th>
			<!--<th class="bgtt" style="border-bottom:0;" width="91">支付/发货</th>-->
			<th class="bgtt" width="121">状态</th>
		</tr>
		</table>
		<!--{foreach($info_list as $k=>$v):}-->
		<div class="order_tt">	
			<span class="order_tt1">订单编号：{$v['order_id']}<!--{if($v['pintuan_id']):}--><a href="{$pe['host']}index.php?mod=order&act=pintuan&id={$v['pintuan_id']}" target="_blank" class="mal10 c999">（拼团号：{$v['pintuan_id']}）</a><!--{endif;}--></span>
			<span class="order_tt2">下单日期：{pe_date($v['order_atime'])}</span>
			<span class="order_tt2"><!--{if($v['order_ptime']):}-->付款日期：{pe_date($v['order_ptime'])}<!--{endif;}--></span>
			<div class="clear"></div>
			<span class="fl">收货地址：{$v['user_tname']}，{$v['user_phone']}，{$v['user_address']}</span>
			<span class="fl mat8 mar10 copy" data-clipboard-text="{$v['user_tname']}，{$v['user_phone']}，{$v['user_address']}"></span>
			<!--{if($v['order_text']):}--><span class="fl corg">【买家留言：{$v['order_text']}】</span><!--{endif;}-->
			<!--{if($v['order_remark']):}--><span class="fl corg">【卖家备注：{$v['order_remark']}】</span><!--{endif;}-->
			<div class="clear"></div>
			<div style="position:absolute;top:15px;right:0">
				<!--{if($v['order_state']=='wpay'):}-->
				<a class="btn_org mar5" href="admin.php?mod=order&act=pay&id={$v['order_id']}" onclick="return pe_dialog(this, '订单付款', 700, 400, 'order_pay')">立即付款</a>
				<a class="btn_gray mar5" href="admin.php?mod=order&act=money&id={$v['order_id']}" onclick="return pe_dialog(this, '修改价格', 1000, 650, 'order_money')">修改价格</a>
				<!--{elseif($v['order_state'] == 'wcheck'):}-->
				<a class="btn_green mar5" href="javascript:pe_confirm('审核通过', 'admin.php?mod=order&act=check&id={$v['order_id']}&token={$pe_token}')">审核通过</a>
				<!--{elseif($v['order_state'] == 'whx'):}-->
				<a class="btn_blue mar5" href="javascript:pe_confirm('核销订单', 'admin.php?mod=order&act=hexiao&id={$v['order_id']}&token={$pe_token}')">确认核销</a>
				<!--{elseif($v['order_state'] == 'wsend'):}-->
				<a class="btn_blue mar5" href="admin.php?mod=order&act=send&id={$v['order_id']}" onclick="return pe_dialog(this, '订单发货', 700, 450, 'order_send')">去发货</a>
				<!--{elseif($v['order_state'] == 'wget'):}-->
				<a class="btn_green mar5" href="javascript:pe_confirm('买家已收到商品', 'admin.php?mod=order&act=success&id={$v['order_id']}&token={$pe_token}')">确认收货</a>
				<!--{endif;}-->
				<a class="btn_gray mar5" href="admin.php?mod=order&act=edit&id={$v['order_id']}" onclick="return pe_dialog(this, '修改订单', 700, 650, 'order_address')">修改订单</a>
				<!--{if(in_array($v['order_state'], array('success', 'close'))):}-->
				<a class="btn_gray mar5" href="javascript:pe_confirm('删除订单', 'admin.php?mod=order&act=del&id={$v['order_id']}&token={$pe_token}')">删除订单</a>
				<!--{else:}-->
				<a class="btn_gray mar5" href="admin.php?mod=order&act=close&id={$v['order_id']}" onclick="return pe_dialog(this, '取消订单', 700, 550, 'order_close')">取消订单</a>
				<!--{endif;}-->
			</div>
		</div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="order_list">
		<tr>
			<td class="left" style="border-left:0;">
				<!--{foreach($v['product_list'] as $kk=>$vv):}-->
				<table width="100%" class="order_tblist">
				<tr>
					<td width="60"><a href="{pe_url('product-'.$vv['product_id'])}" target="_blank"><img src="{pe_thumb($vv['product_logo'], 100, 100)}" width="50" height="50" class="imgbg" /></a></td>
					<td>
						<a href="{pe_url('product-'.$vv['product_id'])}" target="_blank" class="cblue">{$vv['product_name']}</a>
						<p class="mat10">{order_skushow($vv['product_rule'], 'html')}<!--{if($vv['huodong_tag']):}--><span class="tag_red">{$vv['huodong_tag']}</span><!--{endif;}--></p>
					</td>
					<!--{if($vv['product_point'] > 0):}-->
					<td width="100" class="right">{$vv['product_point']} 积分 (×{$vv['product_num']})</td>
					<!--{else:}-->
					<td width="100" class="right">¥ {$vv['product_money']} (×{$vv['product_num']})</td>
					<!--{endif;}-->					
					<td width="80" class="right">
						<!--{if($vv['refund_state']):}-->
						<a href="admin.php?mod=refund&act=view&id={$vv['refund_id']}" target="_blank">{refund_stateshow($vv['refund_state'], 'html')}</a>
						<!--{endif;}-->
					</td>
				</tr>
				</table>
				<!--{endforeach;}-->
			</td>
			<td width="130" style="padding:0">
				<!--{if($v['order_point'] > 0 && $v['order_money'] > 0):}-->
				<p class="corg strong">{$v['order_point']}积分 + {$v['order_money']}元</p>
				<!--{elseif($v['order_point'] > 0):}-->
				<p class="corg strong">{$v['order_money']}积分</p>
				<!--{else:}-->
				<p class="corg strong">{$v['order_money']}</p>
				<!--{endif;}-->
				<p class="c999 mat5">（含运费：{$v['order_wl_money']}）</p>
				<p class="c999 mat5">{$v['order_payment_name']}</p>
			</td>
			<td width="130" style="padding:0">{$v['user_name']}</td>
			<!--<td width="90">
				<img src="{$pe['host_tpl']}image/fu_{$v['order_pstate']}.png" title="{pe_date($v['order_ptime'])}" />
				<img src="{$pe['host_tpl']}image/fa_{$v['order_sstate']}.png" title="{pe_date($v['order_stime'])}" />
				<p><a href="javascript:print_btn('admin.php?mod=order&act=print_product&id={$v['order_id']}')" class="cblue">《配送单》</a></p>
				<p><a href="admin.php?mod=order&act=print_product&id={$v['order_id']}" class="c999" onclick="return pe_dialog(this, '打印发货单', 400, 580)">[发货单]</a></p>
			</td>-->
			<td width="130" style="padding:0;border-right:0;">{order_stateshow($v['order_state'], 'html')}<p class="mat5"><a href="admin.php?mod=order&act=view&id={$v['order_id']}" target="_blank" class="c999">订单详情</a></p></td>
		</tr>
		</table>
		<!--{endforeach;}-->
	</div>
	<div class="right_bottom">
		<span class="fr fenye">{$db->page->html}</span>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript" src="{$pe['host']}include/plugin/my97/WdatePicker.js"></script>
<script type="text/javascript" src="{$pe['host']}include/js/clipboard.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#export_btn").click(function(){
		pe_open("admin.php?{$_SERVER['QUERY_STRING']}&act=export");
	})
	//复制
	var clipboard = new Clipboard('.copy');
	clipboard.on('success', function(e) {
		pe_tip('复制成功');
		e.clearSelection();
		clipboard.destroy();
	});
	clipboard.on('error', function(e) {
		pe_tip('复制失败');
	});
})
function print_btn(url) {
	pe_confirm("打印配送单", function(){
		pe_get(url, function(json){
			pe_tip(json.show);
		})
	})
}
</script>
<!--{include(pe_tpl('footer.html'));}-->